package com.mzy.datepackage.M2022.May.twThree;

import java.lang.reflect.Field;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author mzy
 * @Date 2022/5/23 10:34
 * @Version 1.0
 */
public class TestMain {
    public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException, NoSuchFieldException {
        ClassLoaderTest classLoaderTest = new ClassLoaderTest();

        /**
         * 暂缓，有点奇怪
         */

        Object aClass = Class.forName("com.mzy.datepackage.M2022.May.twThree.ClassLoaderTest");
        Object o = aClass.getClass().newInstance();
        System.out.println();
        for (Field declaredField : aClass.getClass().getDeclaredFields()) {

            System.out.println(declaredField);
        }
        System.out.println(classLoaderTest.getName());
        classLoaderTest.setName("小明");
        System.out.println(classLoaderTest.getName());
    }
}
